﻿/*	@file	r_math_aabb.h
	@brief	バウンディングボックス
Copyright (c) 2009 Yuya Yamaguchi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef _R_MATH_AABB_H_
#define _R_MATH_AABB_H_

#include "r_math_vector3.h"
#include "../rtti/r_rtti_class_base.h"

namespace r{
	namespace math{
		struct AABB : public r::rtti::ClassBase {
			RRTTI_REFLECTION_DECLARE
		public:
			//! コンストラクタ
			AABB();
			AABB ( const AABB& src );
			AABB ( const r::math::Vector3D& smin, const r::math::Vector3D& smax );
			AABB ( r_f32 sminx, r_f32 sminy, r_f32 sminz, r_f32 smaxx, r_f32 smaxy, r_f32 smaxz );
			AABB ( const r_f32* src );
		public:
			//! バウンディングボックスを初期化する
			/*! 初期化直後のデータはAABBとして不正な値が格納されています
			*/
			void		empty ( void );
			//! バウンディングボックスに座標を追加する
			/*!
			*/
			void		addPoint ( const r::math::Vector3D& point );
		public:
			r::math::Vector3D			min;
			r::math::Vector3D			max;
		};
	}
}


#endif //  _R_MATH_AABB_H_
